package com.swyc.osschat.Test.designMode.combination.impl;

import com.swyc.osschat.Test.designMode.combination.base.MenuComponent;

/**
 * @description 叶子节点(菜单项)
 * @Author: z156940l@outlook.com
 * @className MenuItem
 * @Date: 2022/7/21 17:35
 */
public class MenuItem extends MenuComponent {

    public MenuItem(String name,int level){
        this.name = name;
        this.level = level;
    }

    @Override
    public void print() {
        for (int i=0;i<level;i++){
            System.out.print("-");
        }
        System.out.println(name);
    }
}